﻿Public Class Tester
    Private Const TesterUserName = "tester"
    Private Const TesterPassword = "testing"

    Private Shared testerInstance

    Private Sub New()
    End Sub

    Private Property Username As String
    Private Property Password As String

    Friend Shared ReadOnly Property HasLogin As Boolean
        Get
            If Tester.Instance.Username Is Nothing Or Tester.Instance.Password Is Nothing Then
                Return False
            End If
            Return True
        End Get
    End Property

    Private Shared ReadOnly Property Instance As Tester
        Get
            If testerInstance Is Nothing Then
                testerInstance = New Tester()
            End If
            Return testerInstance
        End Get
    End Property

    Friend Shared Function Login(ByVal username As String, ByVal password As String)
        If username = Tester.TesterUserName And password = Tester.TesterPassword Then
            Tester.Instance.Username = username
            Tester.Instance.Password = password
            Return True
        End If
        Return False
    End Function
End Class